Skip to content

PMM-15360: Gate OpenManager's nav and page on the switch - #5853

Open
plebioda wants to merge 3 commits into
PMM-15360-om-switch-flagfrom
PMM-15360-om-nav-gate
Open

PMM-15360: Gate OpenManager's nav and page on the switch#5853
plebioda wants to merge 3 commits into
PMM-15360-om-switch-flagfrom
PMM-15360-om-nav-gate

Conversation

@plebioda

@plebioda plebioda commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

What

Adds the settings flag as a second gate alongside the MongoDB-monitored check for OpenManager's nav entry, reusing the existing pattern for hiding MongoDB-only nav entries rather than inventing a second mechanism.

OmPage now fails closed on the settings flag too, not just isPMMAdmin: a saved or shared link has to answer "switched off" rather than the API's raw FailedPrecondition or the unauthorized card, which would misreport a disabled feature as a permissions problem to an admin who has every right to be here.

Also adds the technical-preview banner (dismissible per browser via localStorage, not a setting), with an explicit color override on its close button — @percona/peak-ui's MuiAlert theme colors the icon/message slots via theme.palette[severity].contrastText but not .MuiAlert-action, so the default close button was rendering almost invisibly against the warning background.

Ticket: PMM-15360

Stacking

Third of three PRs for PMM-15360. Stacks on PMM-15326-om-ui-nav (#5818, needs OmPage.tsx/navigation.provider.tsx) and #5851 (needs Settings.OpenManager.Enabled) — both are merged in here since there's no single upstream branch with both yet, so this diff includes #5851's changes inline until that one merges. Only the last commit ("Gate OpenManager's nav and page on the switch") is net-new here.

Feature build: N/A on its own, same reasoning as #5851/#5852 — pairs with that PR to make the switch fully functional.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.77%. Comparing base (839e3dc) to head (e7855bf).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           PMM-15360-om-switch-flag    #5853      +/-   ##
============================================================
+ Coverage                     46.75%   46.77%   +0.02%     
============================================================
  Files                           431      431              
  Lines                         45132    45162      +30     
============================================================
+ Hits                          21100    21124      +24     
- Misses                        21977    21986       +9     
+ Partials                       2055     2052       -3     
Flag Coverage Δ
admin 34.93% <ø> (ø)
agent 51.43% <ø> (+0.01%) ⬆️
managed 46.91% <ø> (-0.01%) ⬇️
vmproxy 74.16% <ø> (+1.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@plebioda
plebioda force-pushed the PMM-15360-om-nav-gate branch from aa49daf to 0eac8af Compare August 31, 2026 08:20
@plebioda
plebioda force-pushed the PMM-15326-om-ui-nav branch from a28f277 to 69628ee Compare August 31, 2026 09:50
Base automatically changed from PMM-15326-om-ui-nav to PMM-15299-open-manager August 31, 2026 10:08
@plebioda
plebioda force-pushed the PMM-15360-om-nav-gate branch from 0eac8af to 53f52f5 Compare August 31, 2026 10:26
@plebioda
plebioda changed the base branch from PMM-15299-open-manager to PMM-15360-om-switch-flag August 31, 2026 10:38
@plebioda
plebioda force-pushed the PMM-15360-om-nav-gate branch from 53f52f5 to e7855bf Compare August 31, 2026 10:38
@plebioda
plebioda force-pushed the PMM-15360-om-switch-flag branch from 839e3dc to 1de5337 Compare August 31, 2026 10:59
@plebioda
plebioda force-pushed the PMM-15360-om-nav-gate branch from e7855bf to 1126d36 Compare August 31, 2026 10:59
@plebioda
plebioda force-pushed the PMM-15360-om-switch-flag branch from 1de5337 to be40598 Compare August 31, 2026 11:13
@plebioda
plebioda force-pushed the PMM-15360-om-nav-gate branch 2 times, most recently from 5cdb1b9 to d33bdfd Compare August 31, 2026 11:50
@plebioda

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

OpenManager navigation entries now appear only when settings.omEnabled is enabled. OmPage reads the readonly setting and a local-storage dismissal flag. When OpenManager is disabled, the page renders an informational alert. When it is enabled, the page renders a dismissible technical-preview warning banner above its content. The dismissal state persists per browser.

Merge Risk: 🟡 Moderate · up to d33bd

The route currently mounts OpenManager when the controlling setting is still loading or unavailable, so direct or shared links can expose the feature UI despite the switch being off or unresolved. This is a bounded UI gating issue; the existing role check remains, but the route should fail closed before merge.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: gating OpenManager navigation and page access on the settings switch.
Description check ✅ Passed The description explains the settings gate, fail-closed page behavior, technical-preview banner, related ticket, stacking context, and feature-build status. It is sufficiently complete for this change…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the settings gate, fail-closed page behavior, technical-preview banner, related ticket, stacking context, and feature-build status. It is sufficiently complete for this change.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ui/apps/pmm/src/om/OmPage.tsx (1)

112-112: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use an MUI primitive or remove the wrapper.

This div only composes children. Replace it with Box, or remove the wrapper when no DOM wrapper is required.

As per coding guidelines, use MUI and @percona/peak-ui components for layout and composition in ui/apps/pmm/**/*.{ts,tsx}.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f1267792-e20d-4a9e-8b91-7db43656bb37

📥 Commits

Reviewing files that changed from the base of the PR and between be40598 and d33bdfd.

📒 Files selected for processing (2)
  • ui/apps/pmm/src/contexts/navigation/navigation.provider.tsx
  • ui/apps/pmm/src/om/OmPage.tsx
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • percona/pmm-qa (manual)
  • percona/pmm (manual)

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Comment thread ui/apps/pmm/src/om/OmPage.tsx Outdated
@plebioda
plebioda force-pushed the PMM-15360-om-switch-flag branch from be40598 to 04f695f Compare August 31, 2026 12:57
Adds the settings flag as a second gate alongside the MongoDB-monitored
check for OpenManager's nav entry, reusing the existing pattern for
hiding MongoDB-only nav entries rather than inventing a second
mechanism.

OmPage now fails closed on the settings flag too, not just isPMMAdmin:
a saved or shared link has to answer "switched off" rather than the
API's raw FailedPrecondition or the unauthorized card, which would
misreport a disabled feature as a permissions problem to an admin who
has every right to be here. Also adds the technical-preview banner
(dismissible per browser via localStorage, not a setting), with an
explicit color override on its close button -- @percona/peak-ui's
MuiAlert theme colors the icon/message slots via
theme.palette[severity].contrastText but not .MuiAlert-action, so the
default close button was rendering almost invisibly against the
warning background.

Stacks on PMM-15326-om-ui-nav (needs OmPage/navigation.provider.tsx)
and this ticket's own settings-flag PR, merged in here since neither is
available on a single common upstream branch yet.

Signed-off-by: Pawel Lebioda <pawel.lebioda@percona.com>
@plebioda
plebioda force-pushed the PMM-15360-om-nav-gate branch from d33bdfd to eb0ae4e Compare August 31, 2026 12:57
@plebioda
plebioda marked this pull request as ready for review August 31, 2026 13:31
@plebioda
plebioda requested a review from a team as a code owner August 31, 2026 13:31
@plebioda
plebioda requested review from fabio-silva and matejkubinec and removed request for a team August 31, 2026 13:31
navigation.provider.tsx: settings.omEnabled -> settings?.omEnabled,
matching the optional-chaining the sibling backupManagementEnabled
check already uses -- settings can be null before the first fetch
resolves.

settings.provider.tsx: the anonymous-user fallback CombinedSettings
literal was missing omEnabled, now required by the type PMM-15360-
om-switch-flag added. Defaults to false, matching every other flag in
that fallback -- an anonymous session is never a PMM admin, so it
would never see OM's nav entry regardless.

Signed-off-by: Pawel Lebioda <pawel.lebioda@percona.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants